/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.excesys.exsecs.om.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.excesys.exsecs.common.core.util.R;
import com.excesys.exsecs.om.dto.OrderDto;
import com.excesys.exsecs.om.dto.OrderHistoryDto;
import com.excesys.exsecs.om.dto.RepairDto;
import com.excesys.exsecs.om.dto.WarrantyDto;
import com.excesys.exsecs.om.entity.OmWOrder;
import com.excesys.exsecs.om.vo.OrderVo;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 工单表
 *
 * @author weiyj
 * @date 2023-02-24 13:52:55
 */
public interface OmWOrderService extends IService<OmWOrder> {

	boolean saveOmWOrder(OrderDto orderDto);

	boolean saveRepairOmWOrder(OrderDto orderDto);

	boolean saveMaintenanceOmWOrder(OrderDto orderDto);

	boolean updateOmWOrder(OrderDto orderDto);

	boolean removeOmWOrderById(Serializable id);

	IPage<OrderVo> getOrderWithRelPage(Page page, OmWOrder omWOrder, String flag);

	IPage<OrderVo> getRepairOrderWithRelPage(Page page, OmWOrder omWOrder, String flag);

	IPage<OrderVo> getMintenanceOrderWithRelPage(Page page, OmWOrder omWOrder, String flag);

	IPage<OrderVo> getPage(Page page, OmWOrder omWOrder);

	IPage<OrderVo> getRepairPage(Page page, OmWOrder omWOrder);

	IPage<OrderVo> getMaintenancePage(Page page, OmWOrder omWOrder);

	R<Boolean> operateOmWOrder(OrderHistoryDto orderHistoryDto);

	Map<String, String> getOrderCountMap(Long userId, Long createUserId, Long evaluateUserId);

	Map<String, String> getOrderCountByTimeType(String timeType);

	List<Map<String, String>> getOrderCountByYearMonth();

	String getCurrentOrderNameSeq(String typeName);

	List<Map<String, String>> getOrderCountByDeviceType(String month);

	Map<String, Map<String, String>> getOrderSize();

	List<WarrantyDto> getWarrantyMethod();

	List<RepairDto> getRepairList();

	OmWOrder getByOrderNo(String no);

	IPage<OmWOrder> getHomepage(Page page, OmWOrder omWOrder);

}
